package com.casstime.demo.ano;


import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

import java.util.stream.Collectors;

/**
 * 商品更新消息发送切面
 *
 * @author wu.chen
 * @date 2018/6/20
 */
@Aspect
@Component
public class UserLogAspect {



    @AfterReturning(pointcut = "execution(* com.casstime.demo.service.DemoService.*(..))&& @annotation(userLog)",
            returning = "returnObj")
    public void updateEsProduct(final JoinPoint joinPoint, final UserLog userLog, final Object returnObj) {
        Object[] args = joinPoint.getArgs();
        if (args != null) {
            for (Object object : args) {
                System.out.println(object);
            }
        }
        System.out.println(returnObj);
    }
}
